package cn.slipi.core.component.ratelimiter;

import com.google.common.util.concurrent.RateLimiter;

/**
 * RateLimiterFactory
 */
public class RateLimiterFactory {

    private static final RateLimiterFactory rateLimiterFactory = new RateLimiterFactory();

    private RateLimiterFactory() {
    }

    public static RateLimiterFactory self() {
        return rateLimiterFactory;
    }

    public RateLimiter of(Integer permitsPerSecond) {
        return RateLimiter.create(Double.valueOf(permitsPerSecond));
    }


}
